//Loading
(function(){
	var	ZERG_LOADING_Content = '<span>正在载入..</span>';
	var	ZERG_LOADING_ID = 'zergling-loading-wrap';
 	var YD = YAHOO.util.Dom, YE = YAHOO.util.Event;
	var css =  document.createElement('style');
	css.setAttribute('type','text/css');
	var head = document.getElementsByTagName('head')[0];
	head.appendChild(css);
	var loading_cssStyle = css.sheet || css.styleSheet;
	if(loading_cssStyle.insertRule){
		loading_cssStyle.insertRule('body * { visibility:hidden; }', 0);
		loading_cssStyle.insertRule('body #'+ZERG_LOADING_ID+' { visibility:visible; }', 1);
		loading_cssStyle.insertRule('body #'+ZERG_LOADING_ID+' * { visibility:visible; }', 2);
	}else{
		loading_cssStyle.addRule('body *', 'visibility:hidden', 0);
		loading_cssStyle.addRule('body #'+ZERG_LOADING_ID, 'visibility:visible', 1);
		loading_cssStyle.addRule('body #'+ZERG_LOADING_ID +' *', 'visibility:visible', 2);
	}
	document.write('<div id="zergling-loading-wrap">'+ZERG_LOADING_Content+'</div>');
	YE.on(window,'load',function(){
		var loading_wrap = YD.get(ZERG_LOADING_ID);
		loading_wrap.parentNode.removeChild(loading_wrap);
		if (loading_cssStyle.deleteRule){
			loading_cssStyle.deleteRule(loading_cssStyle);
		} else {
			loading_cssStyle.removeRule(loading_cssStyle);
		}
	});
})();

